// 审核列表
export const approveTableList = [
  {
    name: '供应商号',
    value: 'createByVendorNbr',
    minWidth: '110'
  },
  {
    name: '部门',
    value: 'deptNbr',
    minWidth: '80'
  },
  {
    name: 'Fineline',
    value: 'finelineNbr',
    minWidth: '100'
  },
  {
    name: 'UPC',
    value: 'upc',
    minWidth: '100'
  },
  {
    name: 'UPC(不含检验码)',
    value: 'sku',
    minWidth: '130'
  },
  {
    name: '商品名称',
    value: 'skuName',
    minWidth: '100'
  },
  {
    name: '品牌名称',
    value: 'brandName',
    minWidth: '100'
  },
  {
    name: '建品方式',
    value: 'creationWayDec',
    minWidth: '100'
  },
  {
    name: '状态',
    value: 'mainStatusDec',
    minWidth: '100'
  },
  {
    name: '创建时间',
    value: 'createdTime',
    minWidth: '150'
  },
  {
    name: '更新时间',
    value: 'updatedTime',
    minWidth: '150'
  },
  {
    name: '操作',
    width: '110',
    fixed: 'right',
    btnList: [
      { text: '查看', on: 'examine', choose: {} },
      { text: '操作日志', on: 'operationLog', choose: {} }
    ]
  }
]

export const scheduleListID = {
  processingTasks: 'processingTasks', // 待处理
  allTasks: 'allTasks', // 所有任务
  historicalTasks: 'historicalTasks' // 历史建品
}

// 历史任务
const historicalTasks = [
  {
    name: 'item_ID',
    value: 'itemId',
    minWidth: '110',
    show: true,
    disabled: true
  },
  {
    name: 'UPC(不含检验码)',
    value: 'sku',
    minWidth: '130',
    show: true
  },
  {
    name: '商品名称',
    value: 'skuName',
    minWidth: '100',
    show: true,
    disabled: true
  },
  {
    name: '供应商名称',
    value: 'vendorName',
    minWidth: '100',
    show: true
  },
  {
    name: '部门',
    value: 'deptNbr',
    minWidth: '100',
    show: true
  },
  {
    name: 'Fineline',
    value: 'finelineNbr',
    minWidth: '100',
    show: true
  },
  {
    name: '校验状态',
    value: 'validateStatusDec',
    minWidth: '100',
    show: true,
    disabled: true
  },
  {
    name: '创建时间',
    value: 'createdTime',
    minWidth: '100',
    show: true
  },
  {
    name: '错误信息',
    value: 'validateMsg',
    minWidth: '100',
    show: true,
    disabled: true
  }
]

// 列表的操作按钮
const scheduleListOperation = {
  [scheduleListID.processingTasks]: [
    {
      name: '操作',
      width: '130',
      value: 'operation',
      fixed: 'right',
      show: true,
      disabled: true,
      btnList: [
        {
          text: '查看',
          on: 'examine',
          choose: {
            range: ['mainStatus'],
            mainStatusMin: '2000'
          }
        },
        {
          text: '选择建品标准',
          on: 'selectionCriteria',
          choose: {
            value: ['mainStatus'],
            mainStatus: ['800']
          }
        },
        {
          text: '选择建品方式',
          on: 'chooseType',
          choose: {
            value: ['mainStatus'],
            mainStatus: ['1000']
          }
        },
        {
          text: '补充委托信息',
          on: 'entrustInfo',
          choose: {
            value: ['mainStatus'],
            mainStatus: ['2000']
          }
        },
        {
          text: '提交委托',
          on: 'submitInfo',
          choose: {
            value: ['mainStatus'],
            mainStatus: ['2000', '3050']
          }
        },
        {
          text: '制作',
          on: 'make',
          choose: {
            value: ['mainStatus'],
            mainStatus: ['4000', '5020', '6020']
          }
        }, // 制作中且选择的建品方式为自主建品
        {
          text: '提交审核',
          on: 'submitReview',
          choose: {
            value: ['mainStatus'],
            mainStatus: ['4000', '5020', '6020']
          }
        },
        { text: '操作日志', on: 'operationLog' }
      ]
    }
  ],
  [scheduleListID.allTasks]: [
    {
      name: '操作',
      width: '130',
      value: 'operation',
      fixed: 'right',
      show: true,
      disabled: true,
      btnList: [
        {
          text: '查看',
          on: 'examine',
          choose: {
            range: ['mainStatus'],
            mainStatusMin: '2000'
          }
        },
        {
          text: '作废',
          on: 'abandoned',
          choose: {
            range: ['mainStatus'],
            mainStatusMin: '500',
            mainStatusMax: '6020'
          }
        },
        {
          text: '操作日志',
          on: 'operationLog',
          choose: {
            range: ['mainStatus'],
            mainStatusMin: '800'
          }
        }
      ]
    }
  ]
}

// 建品列表
export const scheduleList = (type) => {
  let arr = []
  if (type === scheduleListID.historicalTasks) return historicalTasks
  let operation = []
  if (scheduleListOperation[type]) {
    operation = scheduleListOperation[type]
    arr = [
      {
        name: 'SKU类型',
        value: 'skuTypeDec',
        minWidth: '100',
        show: true
      }
    ]
  }
  return [
    {
      type: 'selection',
      name: '复选框',
      value: 'selection',
      width: '40',
      minWidth: '110',
      fixed: 'left',
      show: true,
      disabled: true
    },
    {
      name: '供应商号',
      value: 'createByVendorNbr',
      minWidth: '110',
      show: true
    },
    {
      name: '部门',
      value: 'deptNbr',
      minWidth: '80',
      show: true
    },
    {
      name: 'Fineline',
      value: 'finelineNbr',
      minWidth: '100',
      show: true
    },
    {
      name: 'UPC',
      value: 'upc',
      minWidth: '100',
      show: true,
      disabled: true
    },
    {
      name: 'UPC(不含检验码)',
      value: 'sku',
      minWidth: '130',
      show: true
    },
    {
      name: '商品名称',
      value: 'skuName',
      minWidth: '100',
      show: true,
      disabled: true
    },
    {
      name: '品牌名称',
      value: 'brandName',
      minWidth: '100',
      show: true
    },
    ...arr,
    {
      name: '建品供应商号',
      value: 'buildVendorNbr',
      minWidth: '120',
      show: true
    },
    {
      name: '供应商名称',
      value: 'createByVendorName',
      minWidth: '100',
      show: true
    },
    {
      name: '建品标准',
      value: 'buildStandardDec',
      minWidth: '100',
      show: true
    },
    {
      name: '建品方式',
      value: 'creationWayDec',
      minWidth: '100',
      show: true
    },
    {
      name: '状态',
      value: 'mainStatusDec',
      minWidth: '100',
      show: true,
      disabled: true
    },
    {
      name: '创建时间',
      value: 'createdTime',
      minWidth: '100',
      show: true
    },
    {
      name: '更新时间',
      value: 'updatedTime',
      minWidth: '100',
      show: true
    },
    ...operation
  ]
}

// 新增建品列表
export const newItemtable = [
  {
    type: 'selection',
    name: '复选框',
    value: 'selection',
    width: '40',
    minWidth: '110',
    fixed: 'left'
  },
  {
    name: '部门',
    value: 'deptNbr',
    minWidth: '80'
  },
  {
    name: 'Fineline',
    value: 'finelineNbr',
    minWidth: '100',
    show: true
  },
  {
    name: '供应商号(6D)',
    value: 'vendorNbr6',
    minWidth: '110'
  },
  {
    name: '供应商名称',
    value: 'vendorName', // todo等字段
    minWidth: '100',
    show: true
  },
  {
    name: 'UPC(不含检验码)',
    value: 'sku',
    minWidth: '130'
  },
  {
    name: '商品名称',
    value: 'skuName',
    minWidth: '100'
  },
  {
    name: '商品类型',
    value: 'itemTypeCode',
    minWidth: '100'
  }
]

// SPU
export const spuListHeader = [
  {
    type: 'selection',
    name: '复选框',
    value: 'selection',
    width: '40',
    minWidth: '110',
    fixed: 'left'
  },
  {
    name: 'SPU ID',
    value: 'id',
    minWidth: '80'
  },
  {
    name: 'SPU名称',
    value: 'spuName',
    minWidth: '80',
    slot: 'spuName'
  },
  {
    name: 'SKU数量',
    value: 'skuCount',
    minWidth: '80'
  },
  {
    name: '状态',
    value: 'mainStatusDesc',
    minWidth: '80'
  },
  {
    name: '状态备注',
    value: 'processRemark',
    minWidth: '80'
  },
  {
    name: '部门',
    value: 'deptNbr',
    minWidth: '80'
  },
  {
    name: '更新人',
    value: 'updateBy',
    minWidth: '80'
  },
  {
    name: '更新时间',
    value: 'updateTime',
    minWidth: '80'
  },
  {
    name: '操作',
    width: '110',
    fixed: 'right',
    btnList: [{ text: '操作日志', on: 'operationLog' }]
  }
]

// 新增spu商品列表

export const addSpuList = (isAddUpc = false) => {
  const arr = isAddUpc ? [] : [{ name: '校验结果', value: 'checkDesc', minWidth: '80' }]
  return [
    {
      type: 'selection',
      name: '复选框',
      value: 'selection',
      width: '40',
      minWidth: '110',
      fixed: 'left'
    },
    {
      name: '部门',
      value: 'deptNbr',
      minWidth: '80'
    },
    {
      name: 'Fineline',
      value: 'fineLineNbr',
      minWidth: '100'
    },
    {
      name: 'UPC(不含检验码)',
      value: 'upcWoCd',
      minWidth: '130'
    },
    {
      name: 'UPC',
      value: 'upcNbr',
      minWidth: '100'
    },
    {
      name: '商品名称',
      value: 'upcName',
      minWidth: '100'
    },
    {
      name: 'VSK',
      value: 'vsk',
      minWidth: '100'
    },
    {
      name: 'SPU ID',
      value: 'spuId',
      minWidth: '80',
      slot: 'spuId'
    },
    ...arr
  ]
}
// 线上商品库列表
export const commodityTableList = [
  {
    type: 'selection',
    name: '复选框',
    value: 'selection',
    width: '40',
    minWidth: '110',
    fixed: 'left'
  },
  {
    name: '主图',
    value: 'imageUrl',
    minWidth: '100',
    slot: 'imageUrl'
  },
  {
    name: 'UPC(不含检验码)',
    value: 'sku',
    minWidth: '130',
    slot: 'sku'
  },
  {
    name: '商品名称',
    value: 'skuName',
    minWidth: '100'
  },
  {
    name: '部门',
    value: 'deptNbr',
    minWidth: '80'
  },
  {
    name: 'Fineline',
    value: 'finelineNbr',
    minWidth: '100'
  },
  {
    name: '建品供应商号',
    value: 'buildVendorNbr',
    minWidth: '120',
    show: true
  },
  {
    name: '供应商名称',
    value: 'buildVendorName',
    minWidth: '100',
    show: true
  },
  {
    name: '所在渠道',
    value: 'channelNames',
    minWidth: '80'
  },
  {
    name: '更新人',
    value: 'updatedBy',
    minWidth: '100'
  },
  {
    name: '更新时间',
    value: 'updatedTime',
    minWidth: '100'
  },
  {
    name: '操作',
    width: '110',
    fixed: 'right',
    btnList: [{ text: '编辑', on: 'edit', choose: {} }]
  }
]
// 线上商品维护列表
export const commodityMaintainList = [
  {
    type: 'selection',
    name: '复选框',
    value: 'selection',
    width: '40',
    minWidth: '110',
    fixed: 'left'
  },
  {
    name: '主图',
    value: 'imageUrl',
    minWidth: '100',
    slot: 'imageUrl'
  },
  {
    name: '渠道',
    value: 'channelId',
    minWidth: '100',
    slot: 'channelId'
  },
  {
    name: 'UPC(不含检验码)',
    value: 'sku',
    minWidth: '130',
    slot: 'sku'
  },
  {
    name: '商品名称',
    value: 'skuName',
    minWidth: '100'
  },
  {
    name: '状态',
    value: 'mainStatus',
    minWidth: '80',
    slot: 'mainStatus'
  },
  {
    name: '备注',
    value: 'remark',
    minWidth: '100'
  },
  {
    name: '修改内容',
    value: 'operationCode',
    minWidth: '120',
    show: true,
    slot: 'operationCode'
  },
  {
    name: '发起人',
    value: 'createdBy',
    minWidth: '100',
    show: true
  },
  {
    name: '发起时间',
    value: 'createdTime',
    minWidth: '100'
  },
  {
    name: '操作',
    width: '110',
    fixed: 'right',
    btnList: [{ text: '操作日志', on: 'operationLog', choose: {} }]
  }
]
// 线上商品审核列表
export const firstTrialList = [
  {
    name: '建品供应商号',
    value: 'buildVendorNbr',
    minWidth: '120'
  },
  {
    name: '渠道',
    value: 'channelId',
    minWidth: '80',
    slot: 'channelId'
  },
  {
    name: '部门',
    value: 'deptNbr',
    minWidth: '80'
  },
  {
    name: 'Fineline',
    value: 'finelineNbr',
    minWidth: '100'
  },
  {
    name: 'UPC',
    value: 'upc',
    minWidth: '100'
  },
  {
    name: 'UPC(不含检验码)',
    value: 'sku',
    minWidth: '120'
  },
  {
    name: '商品名称',
    value: 'skuName',
    minWidth: '150'
  },
  {
    name: '状态',
    value: 'mainStatus',
    minWidth: '100',
    slot: 'mainStatus'
  },
  // {
  //   name: '品牌名称',
  //   value: 'brandName',
  //   minWidth: '100'
  // },
  {
    name: '修改内容',
    value: 'operationCode',
    minWidth: '120',
    slot: 'operationCode'
  },
  {
    name: '创建时间',
    value: 'createdTime',
    minWidth: '150'
  },
  {
    name: '更新时间',
    value: 'updatedTime',
    minWidth: '150'
  },
  {
    name: '操作',
    width: '110',
    fixed: 'right',
    btnList: [
      { text: '查看', on: 'examine', choose: {} },
      { text: '操作日志', on: 'operationLog', choose: {} }
    ]
  }
]
// 白名单供应商配置
export const whiteVendorTableList = [
  {
    type: 'selection',
    name: '复选框',
    value: 'selection',
    width: '40',
    minWidth: '110',
    fixed: 'left'
  },
  {
    name: '6供应商号',
    value: 'vendorNbr6',
    minWidth: '110'
  },
  {
    name: '9供应商号',
    value: 'vendorNbr9',
    minWidth: '110'
  },
  {
    name: '供应商名称',
    value: 'vendorName',
    minWidth: '100'
  },
  {
    name: '是否PB供应商',
    value: 'pbVendorFlag',
    minWidth: '100',
    slot: 'pbVendorFlag'
  },
  {
    name: '是否白名单供应商',
    value: 'whiteListFlag',
    minWidth: '130',
    slot: 'whiteListFlag'
  },
  {
    name: '操作',
    width: '110',
    fixed: 'right',
    btnList: [{ text: '编辑', on: 'edit', choose: {} }]
  }
]

// 渠道商品库沃尔玛到家
export const channelInventoryList = (hasPower) => {
  const arr = []
  if (hasPower && !window.hidden_CBEC_iteration) {
    arr.push({
      name: '业务类型',
      value: 'goodsType',
      minWidth: '100',
      slot: 'goodsType'
    })
  }
  return [
    {
      type: 'selection',
      name: '复选框',
      value: 'selection',
      width: '40',
      minWidth: '110',
      fixed: 'left'
    },
    {
      name: '主图',
      value: 'imageUrl',
      minWidth: '80',
      slot: 'imageUrl'
    },
    {
      name: '渠道商品编号',
      value: 'channelSkuId',
      minWidth: '100'
    },
    {
      name: 'UPC(不含检验码)',
      value: 'sku',
      minWidth: '130',
      slot: 'sku'
    },
    {
      name: '商品名称',
      value: 'skuName',
      minWidth: '100'
    },
    ...arr,
    {
      name: '部门',
      value: 'deptNbr',
      minWidth: '60'
    },
    {
      name: '渠道品牌名称',
      value: 'brandName',
      minWidth: '120'
    },
    {
      name: '渠道平台类目',
      value: 'categoryName',
      minWidth: '120',
      slot: 'categoryName'
    },
    {
      name: '渠道店内类目',
      value: 'skuCategories',
      minWidth: '120',
      slot: 'skuCategories'
    },
    {
      name: '发布状态',
      value: 'lastPushResult',
      minWidth: '80',
      slot: 'lastPushResult'
    },
    {
      name: '返回结果',
      value: 'lastPushFailMsg',
      minWidth: '80'
    },
    // {
    //   name: '商家上下架状态',
    //   value: 'deptNbr',
    //   minWidth: '80'
    // },
    {
      name: '操作',
      width: '110',
      fixed: 'right',
      slot: 'handle',
      btnList: []
    }
  ]
}

export const firstTrialList1 = [
  {
    name: '建品供应商号',
    value: 'buildVendorNbr',
    minWidth: '120'
  },
  {
    name: '渠道',
    value: 'channelId',
    minWidth: '80',
    slot: 'channelId'
  },
  {
    name: '部门',
    value: 'deptNbr',
    minWidth: '80'
  },
  {
    name: 'Fineline',
    value: 'finelineNbr',
    minWidth: '100'
  },
  {
    name: 'UPC',
    value: 'upc',
    minWidth: '100'
  },
  {
    name: 'UPC(不含检验码)',
    value: 'sku',
    minWidth: '120'
  },
  {
    name: '商品名称',
    value: 'skuName',
    minWidth: '150'
  },
  {
    name: '品牌名称',
    value: 'brandName',
    minWidth: '100'
  },
  {
    name: '状态',
    value: 'mainStatus',
    minWidth: '100',
    slot: 'mainStatus'
  },
  {
    name: '修改内容',
    value: 'operationCode',
    minWidth: '120',
    slot: 'operationCode'
  },
  {
    name: '创建时间',
    value: 'createdTime',
    minWidth: '150'
  },
  {
    name: '更新时间',
    value: 'updatedTime',
    minWidth: '150'
  },
  {
    name: '操作',
    width: '110',
    fixed: 'right',
    btnList: [
      { text: '查看', on: 'examine', choose: {} },
      { text: '操作日志', on: 'operationLog', choose: {} }
    ]
  }
]

// sku沃尔玛到家
export const channelInventoryListTo = [
  {
    type: 'selection',
    name: '复选框',
    value: 'selection',
    width: '40',
    minWidth: '110',
    fixed: 'left'
  },
  {
    name: '主图',
    value: 'imageUrl',
    minWidth: '100',
    slot: 'imageUrl'
  },
  {
    name: '渠道商品编号',
    value: 'skuChannelInfo',
    minWidth: '100',
    slot: 'channelSkuId'
  },
  {
    name: 'UPC(不含检验码)',
    value: 'upcWoCd',
    minWidth: '130'
    // slot: 'sku'
  },
  {
    name: '商品名称',
    value: 'upcName',
    minWidth: '100'
  },
  {
    name: '部门',
    value: 'deptNbr',
    minWidth: '80'
  },
  {
    name: '渠道品牌名称',
    value: 'skuChannelInfo',
    minWidth: '120',
    slot: 'skuChannelInfo'
  },
  {
    name: '渠道平台类目',
    value: 'skuChannelInfo',
    minWidth: '120',
    slot: 'skuChannelInfocategoryName'
  },
  {
    name: '渠道店内类目',
    value: 'skuCategories',
    minWidth: '120',
    slot: 'skuChannelInfoskuCategories'
  },
  {
    name: '发布状态',
    value: 'lastPushResult',
    minWidth: '80',
    slot: 'skuChannelInfolastPushResult'
  },
  {
    name: '返回结果',
    value: 'lastPushFailMsg',
    minWidth: '80',
    slot: 'lastPushFailMsg'
  },
  // {
  //   name: '商家上下架状态',
  //   value: 'deptNbr',
  //   minWidth: '80'
  // },
  {
    name: '操作',
    width: '110',
    fixed: 'right',
    slot: 'handle',
    btnList: []
  }
]
